home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / cadd.c < prev    next >
C/C++ Source or Header  |  1991-09-24  |  2KB  |  82 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *                N O T I C E                *
  4.  *                                    *
  5.  *            Copyright Abandoned, 1987, Fred Fish        *
  6.  *                                    *
  7.  *    This previously copyrighted work has been placed into the    *
  8.  *    public domain by the author (Fred Fish) and may be freely used    *
  9.  *    for any purpose, private or commercial.  I would appreciate    *
  10.  *    it, as a courtesy, if this notice is left in all copies and    *
  11.  *    derivative works.  Thank you, and enjoy...            *
  12.  *                                    *
  13.  *    The author makes no warranty of any kind with respect to this    *
  14.  *    product and explicitly disclaims any implied warranties of    *
  15.  *    merchantability or fitness for any particular purpose.        *
  16.  *                                    *
  17.  ************************************************************************
  18.  */
  19.  
  20.  
  21. /*
  22.  *  FUNCTION
  23.  *
  24.  *    cadd   double precision complex addition
  25.  *
  26.  *  KEY WORDS
  27.  *
  28.  *    cadd
  29.  *    complex functions
  30.  *    machine independent routines
  31.  *    math libraries
  32.  *
  33.  *  DESCRIPTION
  34.  *
  35.  *    Computes double precision complex result of addition of
  36.  *    first double precision complex argument with second double
  37.  *    precision complex argument.
  38.  *
  39.  *    Note that the complex addition function is
  40.  *    so simple that it would not normally be called as a function
  41.  *    but simply done "inline".  It is supplied mostly for
  42.  *    completeness.
  43.  *
  44.  *  USAGE
  45.  *
  46.  *    COMPLEX cadd (z1, z2)
  47.  *    COMPLEX z1;
  48.  *    COMPLEX z2;
  49.  *
  50.  *  PROGRAMMER
  51.  *
  52.  *    Fred Fish
  53.  *    Tempe, Az 85281
  54.  *    (602) 966-8871
  55.  *
  56.  *  INTERNALS
  57.  *
  58.  *    Computes cadd(z1,z2) from:
  59.  *
  60.  *        1.    Let z1 = a + j b
  61.  *            Let z2 = c + j d
  62.  *
  63.  *        2.    Then cadd(z1,z2) = (a + c) + j (b + d)
  64.  *
  65.  */
  66.  
  67. #include <stdio.h>
  68. #include <pmluser.h>
  69. #include "pml.h"
  70.  
  71.  
  72. COMPLEX cadd (z1, z2)
  73. COMPLEX z1;
  74. COMPLEX z2;
  75. {
  76.     ENTER ("cadd");
  77.     z1.real += z2.real;
  78.     z1.imag += z2.imag;
  79.     LEAVE ();
  80.     return (z1);
  81. }
  82.